package com.apexcode.rabbitmqspringboot.listener;

import com.apexcode.rabbitmqspringboot.constant.Constants;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @ClassName FanoutListener
 * @Description
 * @Author ZJX
 * @Date 2025/1/9 16:23
 * @Version 1.0
 **/
@Component
public class FanoutListener {
    @RabbitListener(queues = Constants.FANOUT_QUEUE1)
    public void queueListener1(Message message){
        System.out.println("["+Constants.FANOUT_QUEUE1+"] 接收到信息: " + message);
    }
    @RabbitListener(queues = Constants.FANOUT_QUEUE2)
    public void queueListener2(Message message){
        System.out.println("["+Constants.FANOUT_QUEUE2+"] 接收到信息: " + message);
    }
}
